import axios from 'axios';
import { Pagination, PaginationData } from '@/types/global';

export interface EnterpriseVo {
  adminer: string;
  faxName: string;
  faxNo: string;
  name: string;
  phone: string;
  id: string;
}

export interface EnterpriseListParams extends Pagination {
  adminer: string;
  faxName: string;
  faxNo: string;
  name: string;
  phone: string;
  tenantId: string;
}

export function selectPageEnterprise(params: EnterpriseListParams) {
  return axios.post<PaginationData<EnterpriseVo>>(
    'tenant/enterprise/selectPageEnterprise',
    params
  );
}

export function createEnterprise(params: EnterpriseVo) {
  return axios.post('tenant/enterprise/createEnterprise', params);
}

export function editEnterprise(params: EnterpriseVo) {
  return axios.post('tenant/enterprise/editEnterprise', params);
}

export function delEnterprise(id: string) {
  return axios.post(`tenant/enterprise/delete/${id}`);
}
